package cc.comac.mom.api;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import cc.comac.mom.bean.EquipRepair;
import cc.comac.mom.bean.EquipRepairBean;
import cc.comac.mom.util.ResultBean;

@FeignClient(name = "mom-equipment-mgmt-srv")
public interface EquipRepairService {

	@RequestMapping(value = "/p/cs/EquipRepairService/selectByDevNumberAndFaultCause", method = RequestMethod.POST)
	ResultBean selectByDevNumberAndFaultCause(@RequestBody EquipRepairBean obj);

	@RequestMapping(value = "/p/cs/EquipRepairService/updateFaultCauseById", method = RequestMethod.POST)
	ResultBean updateFaultCauseById(@RequestBody EquipRepair obj);

	// 故障提报
	@RequestMapping(value = "/p/cs/EquipRepairService/insetFaultInfo", method = RequestMethod.POST)
	public ResultBean insetFaultInfo(@RequestBody EquipRepair obj);

	// 通过id获取维修信息
	@RequestMapping(value = "/p/cs/EquipRepairService/getById", method = RequestMethod.POST)
	public ResultBean getById(@RequestParam(value = "id") long id);

	// 派工
	@RequestMapping(value = "/p/cs/EquipRepairService/dispatch", method = RequestMethod.POST)
	public ResultBean dispatch(@RequestBody EquipRepair obj);

	// 分配
	@RequestMapping(value = "/p/cs/EquipRepairService/allot", method = RequestMethod.POST)
	public ResultBean allot(@RequestBody EquipRepair obj);

	// 验收
	@RequestMapping(value = "/p/cs/EquipRepairService/acceptance", method = RequestMethod.POST)
	public ResultBean acceptance(EquipRepair obj);

	// 维修分析
	@RequestMapping(value = "/p/cs/EquipRepairService/repairAnalyze", method = RequestMethod.POST)
	public ResultBean repairAnalyze(@RequestBody EquipRepair obj);

	// 维修开始
	@RequestMapping(value = "/p/cs/EquipRepairService/repairBegin", method = RequestMethod.POST)
	public ResultBean repairBegin(@RequestBody EquipRepair obj);

	// 维修结束
	@RequestMapping(value = "/p/cs/EquipRepairService/repairEnd", method = RequestMethod.POST)
	public ResultBean repairEnd(@RequestBody EquipRepair obj);

	// 分页查询
	@RequestMapping(value = "/p/cs/EquipRepairService/selectByCondition", method = RequestMethod.POST)
	public ResultBean selectByCondition(@RequestBody EquipRepair obj);

	@RequestMapping(value = "/p/cs/EquipRepairService/exportData", method = RequestMethod.POST)
	String exportData(@RequestParam(value = "request") HttpServletRequest request, @RequestParam(value = "response") HttpServletResponse response,
			@RequestBody EquipRepair obj);

	// 委外确认
	@RequestMapping(value = "/p/cs/EquipRepairService/outsourcingConfirm", method = RequestMethod.POST)
	public ResultBean outsourcingConfirm(@RequestBody EquipRepair obj);

	// 委外确认
	@RequestMapping(value = "/p/cs/EquipRepairService/printRepairInfoPdf", method = RequestMethod.POST)
	public Map<String, String> printRepairInfoPdf(@RequestParam(value = "repairId") long repairId) throws Exception;

	// 执行汇总
	@RequestMapping(value = "/p/cs/EquipRepairService/queryExecuteCount",method = RequestMethod.POST)
	public ResultBean queryExecuteCount();
}
